package com.xiaoran.rabbitmq.demo.consumer;

import com.rabbitmq.client.Channel;
import com.xiaoran.rabbitmq.demo.config.DelayedQueueCofig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DelayedConsumer {

    //监听消息
    @RabbitListener(queues = DelayedQueueCofig.delayed_queueu_name)
    public void  recevie(Message message, Channel channel){
        String msg=new String(message.getBody());
        System.out.println("我们获取到的消息是："+msg);
    }
}
